<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>FarMenuItemEx</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
</head>
<body>

<h1>FarMenuItemEx</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a  href="index.html">structures</a> |
<a href="../service_functions/menu.html">Menu</a>
<br>
</div>

<div class=shortdescr>
The <dfn>FarMenuItemEx</dfn> structure describes a single menu item.
An array of structures of this type is passed to the <a href="../service_functions/menu.html">Menu</a> function.
In order to use the <dfn>FarMenuItemEx</dfn> structure the <a href="../service_functions/menu.html#FMENU_USEEXT">FMENU_USEEXT</a>
flag should be set when the <dfn>Menu</dfn> function is called.
</div>

<pre class=syntax>
struct FarMenuItemEx
{
  DWORD Flags;
  union {
    char  Text[128];
    const char *TextPtr;
  } Text;
  DWORD AccelKey;
  DWORD Reserved;
  DWORD_PTR UserData;
};
</pre>
<h3>Elements</h3>
<div class=descr>
    <div class=dfn>Flags</div>
    <div class=dfndescr>Combination of the following values (the <a name="FARMENUFLAGS">FARMENUFLAGS</a> enumeration):
    <table class="cont">
      <tr class="cont"><th class="cont" width="40%">Flag</th><th class="cont" width="60%">Description</th></tr>
      <tr class="cont"><td class="cont" width="40%"><a name="MIF_SELECTED">MIF_SELECTED</a></td>
       <td class="cont" width="60%">Denotes a selected menu item. Only one item can be selected.</td></tr>

      <tr class="cont"><td class="cont" width="40%"><a name="MIF_CHECKED">MIF_CHECKED</a></td>
       <td class="cont" width="60%">Denotes a checked menu item. Check sign will be shown near the item.</td></tr>

      <tr class="cont"><td class="cont" width="40%"><a name="MIF_SEPARATOR">MIF_SEPARATOR</a></td>
       <td class="cont" width="60%">The menu item is shown as delimiter.
        Unlike in the <a href="farmenuitem.html">FarMenuItem</a> structure,
        the delimiter can contain text. The text is center-aligned and is not selectable.</td></tr>

      <tr class="cont"><td class="cont" width="40%"><a name="MIF_DISABLE">MIF_DISABLE</a></td>
       <td class="cont" width="60%">Denotes a disabled menu item.</td></tr>

     <tr class="cont"><td class="cont" width="40%"><a name="MIF_GRAYED">MIF_GRAYED</a></td>
     <td class="cont" width="60%">If this flag is set, the menu item is shown, but cannot be selected.</td></tr>

     <tr class="cont"><td class="cont" width="40%"><a name="MIF_HIDDEN">MIF_HIDDEN</a></td>
     <td class="cont" width="60%">If this flag is set, the menu item is not shown.</td></tr>

      <tr class="cont"><td class="cont" width="40%"><a name="MIF_USETEXTPTR">MIF_USETEXTPTR</a></td>
       <td class="cont" width="60%">The menu item uses the <var>Text.TextPtr</var> field.</td></tr>
      </table>
    </div>

    <div class=dfn>Text.Text</div>
    <div class=dfndescr>The text of the menu item.</div>

    <div class=dfn>Text.TextPtr</div>
    <div class=dfndescr>A pointer to the menu item text.
      Used in conjunction with the <dfn>MIF_USETEXTPTR</dfn> flag,
      if the <var>Text.Text</var> array has insufficient size or
      a string from a <a href="../language/language_files.html">language file</a> is used, for example:
    <pre class=code>struct FarMenuItemEx Item;
Item.Flags=MIF_USETEXTPTR;
Item.Text.TextPtr=Info.GetMsg(Info.ModuleNumber,MFooItem);</pre>
    </div>

    <div class=dfn>AccelKey</div>
    <div class=dfndescr>The FAR Manager <a href="../defs/farkeycodes.html">key code</a>
      which will be used to activate the menu item. Example: in the "Commands" menu pressing
      <kbd>Ctrl-O</kbd> is used to the select the "Panels On/Off" menu item.
      As opposed to the <var>BreakKeys</var> parameter of the <a href="../service_functions/menu.html">Menu</a>
      function, the <var>AccelKey</var> field is analogous to the hotkey.
    </div>

    <div class=dfn>Reserved</div>
    <div class=dfndescr>Reserved for future use, should be set to 0.</div>

    <div class=dfn>UserData</div>
    <div class=dfndescr>User data associated with the menu item. FAR Manager does not use this field.</div>
</div>

<h3>Remarks</h3>
<div class=descr>
<ol>
<li>In the low order word of the <var>Flags</var> a field character code can be specified which will be
    displayed as the check mark. In this case, FAR will automatically set the <dfn>MIF_CHECKED</dfn> flag for this
    menu item.
<li>If the low order word of the <var>Flags</var> field is 0 and the <dfn>MIF_CHECKED</dfn> flag is set,
    or if the low order word of the <var>Flags</var> field is 1,
    then the default check mark will be displayed: the character with code 0FBh (<code>&#8730;</code>).
<li>If the <dfn>MIF_SEPARATOR</dfn> flag is used without text, the <var>Text.Text</var> or <var>Text.TextPtr</var>
  fields should be initialized to 0, for example:
    <pre class=code>struct FarMenuItemEx Item;
Item.Flags=MIF_SEPARATOR;
Item.Text.Text[0]=0;</pre>
    or:
    </li>
    <pre class=code>struct FarMenuItemEx Item;
Item.Flags=MIF_SEPARATOR|MIF_USETEXTPTR;
Item.Text.TextPtr=NULL;</pre>
</ol>
</div>

<div class=see>See also:</div><div class=seecont>
<a href="index.html">structures</a> |
<a href="farmenuitem.html">FarMenuItem</a> |
<a href="../delphi/tfarmenuitemex.html">TFarMenuItemEx</a>
</div>

</body>
</html>